﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Root.master" AutoEventWireup="true" CodeBehind="UpdateHistory.aspx.cs" Inherits="StockCrawler.UpdateHistory" %>

<%@ Register Assembly="DevExpress.Web.v14.2, Version=14.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">
    <dx:ASPxSplitter ID="ASPxSplitter2" runat="server" Height="100%">
        <Panes>
            <dx:SplitterPane Size="15%">
                <ContentCollection>
                    <dx:SplitterContentControl runat="server">
                        <div>
                            <table id="UpdateHistory">
                                <tr>
                                    <td>
                                        <dx:ASPxButton ID="btnUpdateHistory" runat="server" Text="Update History" OnClick="btnUpdateHistory_Click"></dx:ASPxButton>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <dx:ASPxLabel ID="lblDate" runat="server" Text="Date Start">
                                        </dx:ASPxLabel>
                                    </td>
                                    <td>
                                        <dx:ASPxDateEdit ID="dateStart" runat="server" EditFormat="Custom" Date="2009-11-02 09:23" Width="100">
                                            <TimeSectionProperties>
                                                <TimeEditProperties EditFormatString="hh:mm tt" />
                                            </TimeSectionProperties>
                                        </dx:ASPxDateEdit>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Date End">
                                        </dx:ASPxLabel>
                                    </td>
                                    <td>
                                        <dx:ASPxDateEdit ID="dateEnd" runat="server" EditFormat="Custom" Date="2009-11-02 09:23" Width="100">
                                            <TimeSectionProperties>
                                                <TimeEditProperties EditFormatString="hh:mm tt" />
                                            </TimeSectionProperties>
                                        </dx:ASPxDateEdit>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <dx:ASPxButton ID="btnView" runat="server" Text="View Result" OnClick="btnView_Click"></dx:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div style="margin-top: 20px">
                            <table id="UpdateLoaiCP">
                                <tr>
                                    <td>
                                        <h3>Cập nhật loại CP</h3>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:FileUpload ID="FileUpload1" runat="server" />
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td>
                                        <dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="Loại CP">
                                        </dx:ASPxLabel>
                                        <dx:ASPxComboBox ID="cbLoaiCP" Width="50px" ClientInstanceName="cboLoaiCPClient" runat="server" SelectedIndex="1" ValueType="System.Boolean">
                                            <Items>
                                                <dx:ListEditItem Text="Tốt" Value="true" />
                                                <dx:ListEditItem Text="Xấu" Value="false" Selected="True" />
                                            </Items>
                                        </dx:ASPxComboBox>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td>
                                        <dx:ASPxButton ID="btnUpdataLoaiCP" runat="server" Text="Update Loại CP" OnClick="btnUpdataLoaiCP_Click"></dx:ASPxButton>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Lưu ý: trong file excel chỉ lưu danh sách mã cổ phiếu từ cột A1 đến An. 
                                        Chương trình sẽ tự động lấy toàn bộ danh sách mã cổ phiếu và cập nhật theo loại cổ phiếu chọn
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <dx:ASPxLabel ID="UploadStatusLabel" runat="server" Text="">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </dx:SplitterContentControl>
                </ContentCollection>
            </dx:SplitterPane>
            <dx:SplitterPane>
                <ContentCollection>
                    <dx:SplitterContentControl runat="server">
                        <dx:ASPxGridView ID="gridHistory" runat="server" AutoGenerateColumns="true" DataSourceID="LinqServerModeDataSourceHistory" ClientInstanceName="detailGridView" KeyFieldName="id_stock" Width="100%">
                            <%--<Columns>
                                <dx:GridViewDataDateColumn Caption="Mã" FieldName="code" ShowInCustomizationForm="True" VisibleIndex="1" Width="70px">
                                </dx:GridViewDataDateColumn>
                                <dx:GridViewDataDateColumn Caption="Sàn" FieldName="stockexchange_name" ShowInCustomizationForm="True" VisibleIndex="1" Width="70px">
                                </dx:GridViewDataDateColumn>
                                <dx:GridViewDataDateColumn Caption="Ngày GD" FieldName="ngay_giao_dich" ShowInCustomizationForm="True" VisibleIndex="1" Width="70px">
                                </dx:GridViewDataDateColumn>
                                <dx:GridViewDataTextColumn Caption="Đóng cửa" FieldName="gia_dong_cua" ShowInCustomizationForm="True" VisibleIndex="2" Width="70px">
                                    <PropertiesTextEdit DisplayFormatString="#,##0.0">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Thay đổi (%)" FieldName="thay_doi" ShowInCustomizationForm="True" VisibleIndex="3" Width="80px">
                                    <PropertiesTextEdit DisplayFormatString="#0.0">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Tham chiếu" FieldName="gia_tham_chieu" ShowInCustomizationForm="True" VisibleIndex="4" Width="80px">
                                    <PropertiesTextEdit DisplayFormatString="#,##0.0">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Mở cửa" FieldName="gia_mo_cua" ShowInCustomizationForm="True" VisibleIndex="5" Width="70px">
                                    <PropertiesTextEdit DisplayFormatString="#,##0.0">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Cao nhất" FieldName="gia_cao_nhat" ShowInCustomizationForm="True" VisibleIndex="6" Width="70px">
                                    <PropertiesTextEdit DisplayFormatString="#,##0.0">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Thấp nhất" FieldName="gia_thap_nhat" ShowInCustomizationForm="True" VisibleIndex="7" Width="70px">
                                    <PropertiesTextEdit DisplayFormatString="#,##0.0">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="KLGD" FieldName="klgd_khop_lenh" ShowInCustomizationForm="True" VisibleIndex="8" Width="70px">
                                    <PropertiesTextEdit DisplayFormatString="#,###">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="GTGD" FieldName="gtgd_khop_lenh" ShowInCustomizationForm="True" VisibleIndex="9" Width="100px">
                                    <PropertiesTextEdit DisplayFormatString="#,###">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="SL mua" FieldName="so_lenh_mua" ShowInCustomizationForm="True" VisibleIndex="14" Width="80px">
                                    <PropertiesTextEdit DisplayFormatString="#,###">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="KL đặt mua" FieldName="kl_dat_mua" ShowInCustomizationForm="True" VisibleIndex="15" Width="80px">
                                    <PropertiesTextEdit DisplayFormatString="#,###">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="SL bán" FieldName="so_lenh_ban" ShowInCustomizationForm="True" VisibleIndex="16" Width="80px">
                                    <PropertiesTextEdit DisplayFormatString="#,###">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="KL đặt bán" FieldName="kl_dat_ban" ShowInCustomizationForm="True" VisibleIndex="17" Width="80px">
                                    <PropertiesTextEdit DisplayFormatString="#,###">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                            </Columns>--%>
                            <SettingsBehavior AllowSelectByRowClick="True" />
                            <SettingsPager Mode="ShowAllRecords">
                                <PageSizeItemSettings ShowAllItem="True" Visible="True">
                                </PageSizeItemSettings>
                            </SettingsPager>
                            <Settings VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" VerticalScrollableHeight="550" />
                        </dx:ASPxGridView>
                        <dx:LinqServerModeDataSource ID="LinqServerModeDataSourceHistory" runat="server" ContextTypeName="StockCrawlerLib.StockDataClassesDataContext" OnSelecting="LinqServerModeDataSourceHistory_Selecting"></dx:LinqServerModeDataSource>
                    </dx:SplitterContentControl>
                </ContentCollection>
            </dx:SplitterPane>
        </Panes>
    </dx:ASPxSplitter>
</asp:Content>
